package com.wjh.order.request;

import java.io.Serial;
import java.io.Serializable;

import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * 下单的商品信息
 * 
 * @author wenjianhai
 * @date 2023/6/22
 * @since JDK 17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ToString(callSuper = true)
public class OrderGoodsRequest implements Serializable {
	@Serial
	private static final long serialVersionUID = -7749860934307445459L;

	/** 商品Guid */
	@NotBlank(message = "请选择商品")
	private String goodsGuid;

	/** 商品名称 */
	@NotBlank(message = "商品名称不能为空")
	private String goodsName;

	/** 购买数量 */
	@NotNull(message = "购买数量不能为空")
	@Min(value = 1, message = "购买数量不能少于1")
	private Integer buyCount;

	/** 优惠金额（单位：分） */
	private Long discount;
}
